package com.wkbb.basic.thread;

import com.wkbb.basic.service.UserOpenService;
import lombok.extern.slf4j.Slf4j;

/**
 * @author dengjingyuan
 * @date 2019-11-15 20:54
 */
@Slf4j
public class ImAutoClassIdByOrgIdTask implements Runnable {

    private Long orgId;

    private UserOpenService userOpenService;

    public ImAutoClassIdByOrgIdTask(Long orgId,UserOpenService userOpenService) {
        this.orgId = orgId;
        this.userOpenService = userOpenService;
    }

    public ImAutoClassIdByOrgIdTask() {

    }

    @Override
    public void run() {
        log.info("*********ImAutoClassIdByOrgIdTask********orgId:{},userOpenService:{}", orgId,userOpenService);
        try {

            log.info("----------准备开启自动修复IM班级群数据--------orgId-{},userOpenService-{}",orgId,userOpenService);

            userOpenService.repairImAllInfo(orgId);
        } catch (Exception e) {
            log.error("*******ImAutoClassIdByOrgIdTask**********", e);
        }
    }
}
